package com.zybzzz.workapp;

import androidx.fragment.app.Fragment;

import android.content.Intent;
import android.view.View;

import com.zybzzz.workapp.activity.PlanMsgActivity;
import com.zybzzz.workapp.activity.SingleFragmentActivity;
import com.zybzzz.workapp.fragment.PlanMsgListFragment;

import java.util.UUID;

public class MainActivity extends SingleFragmentActivity {

    /**
     * 实现抽象类中的创建fragment方法
     * @param: []
     * @return: androidx.fragment.app.Fragment
     * @author: ZhangYiBo
     * @date: 2020/10/15
     */
    @Override
    protected Fragment createFragment() {
        return new PlanMsgListFragment();
    }

    //已经删除原有的oncreate方法 原因是抽象类中已经实现了


    /**
     * 实现点击跳转到添加计划页面，该点击事件在layout界面上被绑定到主界面的悬浮按钮上
     * @param: [view]
     * @return: void
     * @author: ZhangYiBo
     * @date: 2020/10/15
     */
    public void clickToAddActivity(View view){
//        Intent intent = new Intent(this, PlanMsgActivity.class);
        //新分配的uuid
        Intent intent = PlanMsgActivity.makeNewIntentByPlanId(this, UUID.randomUUID());
//        Intent intent = new Intent(this, WeekActivity.class);
        startActivity(intent);
    }

    /**
     * @name: clickToTestWeek
     * @description: 测试导入的日历
     * @param view
     * @return: void
     * @date: 2020-10-23 14:17
     * @auther: zhangyibo
     *
    */
    public void clickToTestWeek(View view){
        Intent intent = new Intent(this, WeekActivity.class);
        startActivity(intent);

    }

}
